package com.share;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author sunxuejian
 * @date 2020/3/17
 */
public class TimeUtil {

    public static void main(String[] args) {

        System.out.println(new Date().toString());
        System.out.println(new Date().getTime());
        System.out.println(System.currentTimeMillis());
        System.out.println(new Timestamp(new Date().getTime()));
        System.out.println(new Timestamp(System.currentTimeMillis()));
        System.out.println((Date)new Timestamp(System.currentTimeMillis()));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String format = sdf.format(new Date());
        System.out.println(format);

    }
}
